package com.cloud.auth.controller;

import java.util.List;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cloud.auth.dao.RoleDao;
import com.cloud.auth.entity.Role;

@RestController
@RequestMapping("/user")
public class UserController {
	@Autowired
	private RoleDao roleDao;
	
	@GetMapping("/t1")
	public String test() {
		List<Role> ls=roleDao.findRoleByUsername("am");
		
		return ls.stream().map(r->r.getRoleName()).collect(Collectors.joining(", "))+"<<<<<<</user/t1";
	}
}
